package mshop.com.schild_kotlin.entitys

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by mayi on 2018/5/30.
 * @Autor CaiWF
 * @Email 401885064@qq.com
 * @TODO
 */
data class PlayInfoBean(val cover:String,val title: String,val author: Author, val playInfo: List<PlayInfo>) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readParcelable(Author::class.java.classLoader),
            parcel.createTypedArrayList(PlayInfo)) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(cover)
        parcel.writeString(title)
        parcel.writeParcelable(author, flags)
        parcel.writeTypedList(playInfo)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<PlayInfoBean> {
        override fun createFromParcel(parcel: Parcel): PlayInfoBean {
            return PlayInfoBean(parcel)
        }

        override fun newArray(size: Int): Array<PlayInfoBean?> {
            return arrayOfNulls(size)
        }
    }
}